package xyz.geminiwen.skinsprite.demo;

import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry;
import ohos.agp.components.Component;
import ohos.app.Context;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import xyz.geminiwen.skinsprite.app.SkinnableComponentLayoutScatter;
import xyz.geminiwen.skinsprite.view.SkinnableDirectionalLayout;

public class LayoutParseTest {

    private Context context;

    @Before
    public void init() {
        context = AbilityDelegatorRegistry.getAbilityDelegator().getAppContext();
    }

    @Test
    public void parseTest() {
        Component component = SkinnableComponentLayoutScatter.getInstance(context).parse(ResourceTable.Layout_ability_main, null, false);
        Assert.assertTrue(component instanceof SkinnableDirectionalLayout);
    }
}
